package com.by.charpter04.utils;

import android.util.Log;

import com.google.gson.Gson;

public class GsonUtil {

    public static String toJson2() {
        Person person = new Person();
        person.setId("01");
        person.setName("华安");
        person.setAge(12);


        Gson gson = new Gson();
        return gson.toJson(person);

    }

    public static Person fromJson2(String personJson) {
        Gson gson = new Gson();
        Person person = gson.fromJson(personJson, Person.class);
        return person;
    }
}
